package model;

public class UrlFile {
	private String url;
	public String fileName;
	private String fileSuffix;
	
	public UrlFile(String url, String fileName, String fileSuffix) {
		this.url = url;
		this.fileName = fileName;
		this.fileSuffix = fileSuffix;
	}
	
	public UrlFile(String url) {
		this.url = url;
		String[] spllited = url.split("/");
		String filePath = spllited[spllited.length -1];
		int indexOfDot = filePath.indexOf('.');
		fileName = filePath.substring(0, indexOfDot);
		fileSuffix = filePath.substring(indexOfDot + 1, filePath.length());
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public String getFileSuffix() {
		return fileSuffix;
	}

	public void setFileSuffix(String fileSuffix) {
		this.fileSuffix = fileSuffix;
	}
	
	@Override
	public String toString()
	{
		return getUrl();
	}

}
